package com.fuhailiu.opengl.utils;

import android.util.Log;

import com.fuhailiu.opengl.define.AppGlobalDef;

public class LogUtil {

	private static boolean mbEnabled = true;

	public static void setEnabled(boolean enabled) {
		mbEnabled = enabled;
	}

	public static boolean isEnabled() {
		return mbEnabled;
	}

	public static void LogV(String tag, String msg) {
		if (mbEnabled) {
			Log.v(AppGlobalDef.LOG_TAG, getLogMessage(tag, msg));
		}
	}

	public static void LogD(String tag, String msg) {
		if (mbEnabled) {
			Log.d(AppGlobalDef.LOG_TAG, getLogMessage(tag, msg));
		}
	}

	public static void LogI(String tag, String msg) {
		if (mbEnabled) {
			Log.i(AppGlobalDef.LOG_TAG, getLogMessage(tag, msg));
		}
	}

	public static void LogW(String tag, String msg) {
		if (mbEnabled) {
			Log.w(AppGlobalDef.LOG_TAG, getLogMessage(tag, msg));
		}
	}

	public static void LogE(String tag, String msg) {
		if (mbEnabled) {
			Log.e(AppGlobalDef.LOG_TAG, getLogMessage(tag, msg));
		}
	}

	private static String getLogMessage(String tag, String msg) {
		return tag + " " + msg;
	}

}
